﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SharedGenomics.Core;
using SharedGenomics.Workbench.Core;

namespace SharedGenomics.Workbench.Presenters
{
    public class TaskStagePresenter<T> : Presenter, ITaskStagePresenter<T> where T : class, new()
    {
        public TaskStagePresenter(IView view)
            : base(view)
        {
        }

        public void InitialiseStage(MultiStageTask<T> task)
        {
            task.ThrowIfNull("task");
            this.Task = task;
            this.InitialiseStage(task.TaskContext);
        }

        protected virtual void InitialiseStage(T context)
        {
            //subclasses should override this method if they have any initialisation to do based on the task context
        }

        protected MultiStageTask<T> Task { get; private set; }
    }
}
